﻿<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->
<Page
    x:Class="SDKTemplate.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:SDKTemplate"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="768" d:DesignWidth="1366">

    <Page.Resources>
        <Style x:Key="BaseStatusStyle" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Segoe UI Semilight"/>
            <Setter Property="FontSize" Value="14.667"/>
            <Setter Property="Margin" Value="0,0,0,5"/>
        </Style>
        <Style x:Key="StatusStyle" BasedOn="{StaticResource BaseStatusStyle}" TargetType="TextBlock">
            <Setter Property="Foreground" Value="Green"/>
        </Style>
        <Style x:Key="ErrorStyle" BasedOn="{StaticResource BaseStatusStyle}" TargetType="TextBlock">
            <Setter Property="Foreground" Value="Blue"/>
        </Style>
    </Page.Resources>

    <Grid x:Name="LayoutRoot" Background="White">

        <Grid x:Name="ContentRoot">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <!-- Content -->
            <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Grid.Row="1" ZoomMode="Disabled" Margin="50,20,50,20">
                <StackPanel x:Name="ContentPanel">
                    <StackPanel x:Name="Description" Grid.Row="1">

                        <!-- QuickLink -->
                        <TextBlock Style="{StaticResource TitleTextStyle}" Foreground="#db7100" Text="Activation through Quicklink" />
                        <TextBlock Style="{StaticResource BasicTextStyle}">
                            <Bold>ID:</Bold>
                            <Run x:Name="SelectedQuickLinkId" Text="This app was not activated through a frequent Quicklink." />
                            <LineBreak />
                        </TextBlock>

                        <!-- Data Package Properties -->
                        <TextBlock Style="{StaticResource TitleTextStyle}" Foreground="#db7100" Text="Data Package Properties"/>
                        <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" HorizontalAlignment="Left" MaxWidth="500">
                            <Bold>Title:</Bold>
                            <Run x:Name="DataPackageTitle" Text="(No title)" />
                        </TextBlock>
                        <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" HorizontalAlignment="Left" MaxWidth="500">
                            <Bold>Description:</Bold>
                            <Run x:Name="DataPackageDescription" Text="(No description)" />
                        </TextBlock>
                        <StackPanel x:Name="ThumbnailArea" Visibility="Collapsed">
                            <TextBlock x:Name="ThumbnailLabel" Style="{StaticResource BasicTextStyle}" FontWeight="Bold" Text="Thumbnail:" />
                            <Image x:Name="ThumbnailHolder" HorizontalAlignment="Left" MaxWidth="100" Source="images/storeLogo-sdk.png" />
                        </StackPanel>
                        <TextBlock>
                            <LineBreak />
                        </TextBlock>

                        <!-- Data Package Content -->
                        <TextBlock Style="{StaticResource TitleTextStyle}" Foreground="#db7100" Text="Data Package Content"/>
                        <TextBlock x:Name="ContentValue" Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" HorizontalAlignment="Left" MaxWidth="500" />
                        <WebView x:Name="ShareWebView" Visibility="Collapsed" HorizontalAlignment="Left" Width="500" Height="200" />
                        <StackPanel x:Name="ResourceMapArea" Visibility="Collapsed">
                            <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap">
                                <Bold>Resource Map:</Bold>
                                <Run x:Name="ResourceMapValue" Text="(No resource map)" />
                            </TextBlock>
                        </StackPanel>
                        <StackPanel x:Name="ImageArea" Visibility="Collapsed">
                            <TextBlock x:Name="ImageLabel" Style="{StaticResource BasicTextStyle}" FontWeight="Bold" Text="Bitmap:" />
                            <Image x:Name="ImageHolder" HorizontalAlignment="Left" MaxWidth="300" Source="images/placeholder-sdk.png" />
                        </StackPanel>
                        <TextBlock>
                            <LineBreak />
                        </TextBlock>

                        <!-- Share Operation Methods -->
                        <TextBlock Style="{StaticResource TitleTextStyle}" Foreground="#db7100" Text="ShareOperation Methods"/>

                        <!-- Long Running Share -->
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>

                            <TextBlock x:Name="LongRunningShareLabel" Grid.Column="0" Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" TextAlignment="Left" 
                                VerticalAlignment="Center" HorizontalAlignment="Left" Tapped="LongRunningShareLabel_Tapped">
                                Long-running Share Support (Optional)
                            </TextBlock>
                            <CheckBox x:Name="ExpandLongRunningShareSection" Grid.Column="1" IsEnabled="True" IsChecked="False" IsTabStop="True" Margin="1,0,0,0" 
                                VerticalAlignment="Center" HorizontalAlignment="Center" Checked="ExpandLongRunningShareSection_Checked" 
                                Unchecked="ExpandLongRunningShareSection_Unchecked" />
                        </Grid>

                        <StackPanel x:Name="ExtendedSharingArea" HorizontalAlignment="Left" Visibility="Collapsed">
                            <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Width="500" HorizontalAlignment="Left" TextAlignment="Left">
                                <LineBreak/>This API is required if your app supports uploading a format that may take some time, such as images or videos.
                                A user should be able to dismiss your app and have the upload continue in the background while they do other things.
                                In order for the dismiss behavior to work correctly, you need to report to the share platform that you finished getting user input.
                                After you call this API, a user can go back to the share pane and see your application in the share progress list.<LineBreak/>
                            </TextBlock>
                            <Button x:Name="ReportStarted" Content="Report Started" Margin="0,0,10,0" HorizontalAlignment="Right" Click="ReportStarted_Click" />
                            <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Width="500" HorizontalAlignment="Left" TextAlignment="Left">
                                <LineBreak/> This API is optional and helps Windows to optimize resource usage of the system.
                                You should report this if you have finished extracting data from the Data Package.
                                Then Windows can suspend or terminate the source app as necessary to reclaim system resources.<LineBreak/>
                            </TextBlock>
                            <Button x:Name="ReportDataRetrieved" Content="Report Data Retrieved" Margin="0,0,10,0" HorizontalAlignment="Right" Click="ReportDataRetrieved_Click" />
                            <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Width="500" HorizontalAlignment="Left" TextAlignment="Left">
                                <LineBreak/>This API is optional and helps Windows to optimize resource usage of the system.
                                You should report this if you have called the Windows Runtime Background Transfer class to upload your content.
                                Then Windows can suspend your app as necessary to reclaim system resources.
                                If you use this API, you should call it after you called ReportStarted.<LineBreak/>
                            </TextBlock>
                            <Button x:Name="ReportSubmittedBackgroundTask" Content="Report Submitted To BackgroundTask" Margin="0,0,10,0" HorizontalAlignment="Right" Click="ReportSubmittedBackgroundTask_Click" />
                            <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Width="500" HorizontalAlignment="Left" TextAlignment="Left">
                                <LineBreak/>If for any reason the long-running share was unsuccessful and failed in the background,
                                you should report failure and include a message for the user about how they can recover from the error.
                                When the user goes back to the share pane they can see your message in the progress list.
                                You should never call ReportError if your app is visible in the foreground.<LineBreak/>
                            </TextBlock>
                            <TextBlock Style="{StaticResource SubheaderTextStyle}" TextWrapping="Wrap" Text="Error Message: "/>
                            <TextBox x:Name="ReportError" FontSize="12" Width="300" TextWrapping="Wrap" HorizontalAlignment="Left" Text="Could not contact server"/>
                            <Button x:Name="ReportErrorButton" Content="Report Error" Margin="0,0,10,0"  HorizontalAlignment="Right" Click="ReportErrorButton_Click" />
                        </StackPanel>

                        <!-- Report Completed -->
                        <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Width="500"  HorizontalAlignment="Left" TextAlignment="Left">
                            <LineBreak/>Your share target app should ReportCompleted after the share task completes successfully.
                            When reporting completed, you can optionally add a QuickLink to make it easier for users to repeat the way they share most often.
                            This API applies to both quick and long-running shares.<LineBreak/>
                        </TextBlock>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock x:Name="QuickLinkSectionLabel" Grid.Column="0" Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" TextAlignment="Left" 
                                VerticalAlignment="Center" HorizontalAlignment="Left" Tapped="QuickLinkSectionLabel_Tapped">
                                Add a quicklink (Optional)
                            </TextBlock>
                            <CheckBox x:Name="AddQuickLink" Grid.Column="1" IsEnabled="True" IsChecked="False" IsTabStop="True" Margin="1,0,0,0"
                                VerticalAlignment="Center" HorizontalAlignment="Center" Checked="AddQuickLink_Checked" Unchecked="AddQuickLink_Unchecked" />
                        </Grid>

                        <StackPanel x:Name="QuickLinkCustomization" Visibility="Collapsed" Width="500">
                            <TextBlock Style="{StaticResource BasicTextStyle}" Text="Quicklink Id: "/>
                            <TextBox x:Name="QuickLinkId" FontSize="12" Width="300" TextWrapping="Wrap" HorizontalAlignment="Left" Text="ABC123" />
                            <TextBlock Style="{StaticResource BasicTextStyle}" >
                                <LineBreak/>Title:
                            </TextBlock>
                            <TextBox x:Name="QuickLinkTitle" FontSize="12" Width="300" TextWrapping="Wrap" HorizontalAlignment="Left" Text="Email John Smith" />
                            <TextBlock Style="{StaticResource BasicTextStyle}" >
                                <LineBreak/>Icon:
                            </TextBlock>
                            <Image x:Name="QuickLinkIcon" HorizontalAlignment="Left" MaxHeight="100" MaxWidth="100" Source="assets/user.png" />
                        </StackPanel>
                        <StackPanel HorizontalAlignment="Left" Width="500">
                            <Button x:Name="ReportCompleted" Content="Report Completed" Margin="0,0,10,0" HorizontalAlignment="Right" Click="ReportCompleted_Click" />
                        </StackPanel>

                        <!-- Output -->
                        <TextBlock x:Name="StatusBlock" TextWrapping="Wrap" HorizontalAlignment="Left" MaxWidth="500" />
                    </StackPanel>
                </StackPanel>
            </ScrollViewer>

            <!-- Footer -->
            <Grid x:Name="Footer"  Grid.Row="3" Margin="0,10,0,10" VerticalAlignment="Bottom" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image Grid.Row="0"  Source="Assets/microsoft-sdk.png" AutomationProperties.Name="Microsoft Logo" Stretch="None" HorizontalAlignment="Left"/>
                <TextBlock Style="{StaticResource FooterStyle}" Text="© Microsoft Corporation. All rights reserved." TextWrapping="Wrap" Grid.Row="1" HorizontalAlignment="Left"/>
                <StackPanel x:Name="FooterPanel" Orientation="Horizontal" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right">
                    <HyperlinkButton Content="Terms of use" Tag="http://www.microsoft.com/About/Legal/EN/US/IntellectualProperty/Copyright/default.aspx"
                        Click="Footer_Click" FontSize="12" Style="{StaticResource HyperlinkStyle}"/>
                    <TextBlock Text="|" Style="{StaticResource SeparatorStyle}" VerticalAlignment="Center"/>
                    <HyperlinkButton Content="Trademarks" Tag="http://www.microsoft.com/About/Legal/EN/US/IntellectualProperty/Trademarks/EN-US.aspx"
                        Click="Footer_Click" FontSize="12" Style="{StaticResource HyperlinkStyle}"/>
                    <TextBlock Text="|"  Style="{StaticResource SeparatorStyle}" VerticalAlignment="Center"/>
                    <HyperlinkButton Content="Privacy Statement" Tag="http://privacy.microsoft.com" Click="Footer_Click" FontSize="12" Style="{StaticResource HyperlinkStyle}"/>
                </StackPanel>
            </Grid>
        </Grid>
    </Grid>
</Page>
